home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amoszine 8
/
Amoszine 8 (Disk 2 of 3).adf
/
BELL.lha
/
bellv1x.amos
/
bellv1x.amosSourceCode
< prev
Wrap
AMOS Source Code
|
1992-03-06
|
7KB
|
400 lines
'=============================================
'
'BELL V1.x Started 27th June 1995 Midnight
'
'Beginners Easy Learning Language.
'
'=============================================
Screen Open 0,640,250,8,Hires
'-----------------------------------------------
'how many bell instructions currently supported
'-----------------------------------------------
ROUTINES=25
Dim LISTING$(100) : Rem allowable lines of code in ascii script
Global LISTING$(),GC$,SPV$,AA,SPEED$,TIMES$,REP
RR:
REP=0
'------------------------------------------
'read in script, program.bell, into script$
'------------------------------------------
Open In 1,"DF0:program.bell"
L=Lof(1)
Close 1
Reserve As Data 6,L
Bload "DF0:program.Bell",6
ST6=Start(6) : E6=ST6+Length(6)
SCRIPT$=Peek$(ST6,L)
'------------------------------------------
'put the script instructions in Listing$()
'------------------------------------------
LAST10=0 : COUNT=1
For A=1 To L
G$=Mid$(SCRIPT$,A,1)
If G$=Chr$(10)
CHARS=A-1-LAST10
LISTING$(COUNT)=Mid$(SCRIPT$,LAST10+1,CHARS)
LAST10=A
'Print LISTING$(COUNT)
Inc COUNT
End If
Next A
'------------------
'execute the script
'------------------
For AA=1 To COUNT-1
GC$=LISTING$(AA)
_SETUP
Next AA
If REP=1 Then Goto RR
'------------------------------------
'this calls the instructions according to
'commands passed to it in gc$
'------------------------------------
Procedure _SETUP
'Home : Print GC$
GC$=Upper$(GC$)
If Left$(GC$,9)="SHOW ANIM"
L=Len(GC$)
TIMES$=Right$(GC$,2)-" "
SPV$=Mid$(GC$,11,L)
S$=Right$(SPV$,2)
SPV$=SPV$-S$
SPV$=SPV$-" "
_SHOWANIM
Pop Proc
End If
If Left$(GC$,7)="MESSAGE"
Inc AA
GC$=LISTING$(AA)
SPV$=GC$
_MESSAGE
Pop Proc
End If
If Left$(GC$,8)="SHOW DOC"
SPV$=Right$(GC$,1)
_SHOWDOC
Pop Proc
End If
If Left$(GC$,2)="VT"
SPV$=Right$(GC$,1)
_VT
Pop Proc
End If
If Left$(GC$,14)="NO DRIVE CLICK"
_CLICKNOT
Pop Proc
End If
If Left$(GC$,8)="SHOW PIC"
SPV$=Right$(GC$,1)
_SHOWPIC
Pop Proc
End If
If Left$(GC$,12)="CLEAR SCREEN"
SPV$=Right$(GC$,1)
_CLEARSCREEN
Pop Proc
End If
If Left$(GC$,10)="WAIT MOUSE"
_WAITMOUSE
Pop Proc
End If
If Left$(GC$,8)="WAIT KEY"
_WAITKEY
Pop Proc
End If
If Left$(GC$,5)="PAUSE"
L=Len(GC$)
SPV$=Mid$(GC$,6,L)
SPV$=SPV$-" "
_PAUSE
Pop Proc
End If
If Left$(GC$,11)="PLAY SAMPLE"
L=Len(GC$)
SPEED$=Right$(GC$,2)-" "
SPV$=Mid$(GC$,13,L)
S$=Right$(SPV$,2)
SPV$=SPV$-S$
SPV$=SPV$-" "
_PLAYSAM
Pop Proc
End If
If Left$(GC$,10)="PLAY MUSIC"
SPV$=Right$(GC$,1)
_PLAYMUSIC
Pop Proc
End If
If Left$(GC$,10)="STOP MUSIC"
_STOPMUSIC
Pop Proc
End If
If Left$(GC$,11)="FADE SCREEN"
SPV$=Right$(GC$,1)
_FADESCREEN
Pop Proc
End If
If Left$(GC$,10)="APPEAR PIC"
SPV$=Right$(GC$,1)
_APPEAR
Pop Proc
End If
If Left$(GC$,11)="SQUARE WIPE"
_SQUAREWIPE
Pop Proc
End If
If Left$(GC$,11)="WAVE WIPE"
_WAVEWIPE
Pop Proc
End If
If Left$(GC$,9)="SCROLL DOWN"
_SCROLLDOWN
Pop Proc
End If
If Left$(GC$,10)="WHITE WIPE"
_WHITEWIPE
Pop Proc
End If
If Left$(GC$,8)="MOUSE ON"
_MOUSEON
Pop Proc
End If
If Left$(GC$,9)="MOUSE OFF"
_MOUSEOFF
Pop Proc
End If
If Left$(GC$,9)="CROSSHAIR"
_CROSSHAIR
Pop Proc
End If
If Left$(GC$,9)="CLOCK"
_CLOCK
Pop Proc
End If
If Left$(GC$,9)="POINTER"
_POINTER
Pop Proc
End If
If Left$(GC$,6)="REPEAT"
REP=1
Pop Proc
End If
If Left$(GC$,3)="END"
_END
Pop Proc
End If
Print "Error 0: Syntax error in line";AA : Print GC$
Clear Key : Wait Key
End Proc
'---------------------
'THE BELL COMMAND SET
'---------------------
Procedure _SHOWANIM
LP$="df0:Anims/Anim"+SPV$
S=Val(TIMES$)
Iff Anim LP$ To 0,S
End Proc
Procedure _VT
'not working proply atmo
If Exist("df0:u/VT")
Amos To Back
Exec "df0:U/VT df0:pictures/pic"+SPV$
Amos To Front
Wait 50
End If
End Proc
Procedure _SHOWPIC
LP$="df0:pictures/pic"+SPV$
Trap Load Iff LP$,0
If Errtrap
'its an error so must be abk pic
Load LP$,10
Unpack 10 To 0
Erase 10
End If
End Proc
Procedure _CLEARSCREEN
CLR=Val(SPV$)
Flash Off : Curs Off
Paper CLR : Cls CLR
End Proc
Procedure _WAITMOUSE
While Mouse Key=0 : Wend
End Proc
Procedure _WAITKEY
'Home : Paper 0 : Pen 1 : Print "Press any key.."
K$="" : While K$="" : K$=Inkey$ : Wend
End Proc
Procedure _PAUSE
Wait Val(SPV$)*50
End Proc
Procedure _PLAYSAM
Erase 4
LP$="df0:Samples/sam"+SPV$
Open In 1,LP$
Reserve As Work 4,Lof(1)
Bload LP$,4
S=Val(SPEED$)
Sam Raw 15,Start(4),Length(4),S*1000
Close 1
End Proc
Procedure _PLAYMUSIC
LP$="df0:music/music"+SPV$
Track Load LP$,3
Track Play 3
End Proc
Procedure _STOPMUSIC
Track Stop
Erase 3
End Proc
Procedure _FADESCREEN
F=Val(SPV$)
If F<=0 Then F=1
Fade F
Wait F*7
End Proc
Procedure _APPEAR
LP$="df0:pictures/pic"+SPV$
Load Iff LP$,0
'fades in a picture, on current screen.
Dim C(15)
Screen Hide
For N=0 To 15
C(N)=Colour(N) : Colour N,0
Next
Screen Show : Wait Vbl
Fade 1,C(0),C(1),C(2),C(3),C(4),C(5),C(6),C(7),C(8),C(9),C(10),C(11),C(12),C(13),C(14),C(15)
Wait 15
End Proc
Procedure _SQUAREWIPE
If Screen Width=640
Cls 0 : Locate 0,22
Print "ERROR 1: SQUARE WIPE ONLY WORKS FOR LOW RES PICS (320 WIDTH) Press a key" : Wait Key : Pop Proc
End If
X1=159 : Y1=127 : X2=160 : Y2=128
Ink 0
For A=1 To 160
Bar X1,Y1 To X2,Y2
Inc X2 : Inc Y2 : Dec X1 : Dec Y1
Next A
End Proc
Procedure _WAVEWIPE
If Screen Width=640
Cls 0 : Locate 0,22
Print "ERROR 2: WAVE WIPE ONLY WORKS FOR LOW RES PICS (320 WIDTH) Press a key" : Wait Key : Pop Proc
End If
Ink 0
For X=0 To 319 : Draw 0,255 To X,0 : Next
For Y=1 To 255 : Draw 0,255 To 319,Y : Next
End Proc
Procedure _SCROLLDOWN
For Y=50 To 320
Screen Display 0,128,Y,,
Wait Vbl
Next Y
End Proc
Procedure _WHITEWIPE
For A=0 To 15
Colour A,$FFF
Wait Vbl
Next A
Wait Vbl
Wait 2
End Proc
Procedure _MOUSEON
Show On
End Proc
Procedure _MOUSEOFF
Hide
End Proc
Procedure _SHOWDOC
If Exist("df0:u/ppmore")
Amos To Back
Exec "df0:U/ppmore df0:docs/doc"+SPV$
Amos To Front
Wait 50
End If
End Proc
Procedure _MESSAGE
Paper 0
Centre SPV$
End Proc
Procedure _CROSSHAIR
Change Mouse 2
End Proc
Procedure _POINTER
Change Mouse 1
End Proc
Procedure _CLOCK
Change Mouse 3
End Proc
Procedure _CLICKNOT
If Exist("df0:U/clicknot")
Exec "df0:U/clicknot"
End If
End Proc
Procedure _END
Default
Screen Open 0,640,256,8,Hires
Flash Off : Curs Off : Cls 0
Paper 0 : Pen 6
Locate 0,22 : Print "End of Program: B.E.L.L V1.0 (C)95 Steve Bye"
Wait 200
Stop
End Proc